home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr49 / do1st_11.zip / DOFIRST.DOC < prev    next >
Text File  |  1995-01-27  |  5KB  |  107 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                        DoFirst
  8.           ═════════════════════════════════════════════════════════════════
  9.  
  10.                The archive should contain the following files:
  11.  
  12.                DOFIRST.EXE............Actual program
  13.                DOFIRST.DOC............Program instructions
  14.                RUN.BAT................Sample batch file
  15.                READ.ME................Update information (if any)
  16.                FILE_ID.DIZ............BBS description file
  17.                HUCKABEY.TXT...........Current list of James Huckabey
  18.                                       software
  19.                ARCHIVE.TXT............This list of files
  20.  
  21.                Ever need to execute programs on  the first day of the month
  22.           and  worked to try and  figure out to do it?  DoFirst does it for
  23.           you. It is nothing fancy.
  24.  
  25.                Can be run everyday without any harm because it does nothing
  26.           at all except  update it's log. It generates an  exitcode of zero
  27.           that means it is the first  day of month and a one means  that it
  28.           is not the  first day of the  month. Each time  it runs it  check
  29.           your  path for a  copy of DOFIRST.EXE  where it stores  it's data
  30.           log. It first looks in current directory then your path statement
  31.           from  the environment. If it finds DOFIRST.EXE it writes it's log
  32.           to that location. If it does  not find DOFIRST.EXE it then writes
  33.           it's log to the current directory.
  34.  
  35.                If it is the first day of the month it checks the log to see
  36.           if it  has already run.  If it has already  run it exits  with an
  37.           error level of 1 same  as it would if it were not the  1st day of
  38.           the month.  If it is the first  day of the month  and the date in
  39.           the log  is not the  current date the program  terminates with an
  40.           exitcode  of 0.  This would  be the  value that  ERRORLEVEL would
  41.           contain.
  42.  
  43.                The time in the  log is the  run time. You  can use this  to
  44.           check  and see at  what time the program  was executed. This goes
  45.           for any execution. On the first day of the month the log  is only
  46.           updated  once, on  other  runnings of  the  program it's  log  is
  47.           updated.
  48.  
  49.                If on the first  day of the month you want  to run DoFirst a
  50.           second time you must  delete it's log DOFIRST.DAT. It  is written
  51.           to the location of  DOFIRST.EXE if located using path  of written
  52.           to the current directory  if not found. When searching  is always
  53.           checks the current directory first.
  54.  
  55.                If it is not the first day  of the month the same search  if
  56.           performed. If the  log is located  it is updated showing  that it
  57.           was not the 1st day of the  month. It exits with an ERRORLEVEL 1.
  58.           In a batch file the ERRORLEVEL would be equal to 1.
  59.  
  60.                Here is a sample batch file which can be modified to suit:
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                Echo Off                   <turn echo off
  68.  
  69.                DOFIRST                    <run DoFirst
  70.  
  71.                IF ERRORLEVEL 1 GOTO END   <if ERRORLEVEL 1 goto exit
  72.                                            (not first day of month)
  73.  
  74.                DoProgram1                 <if ERRORLEVEL 0 do programs
  75.                DoProgram2                 <if any of these are batch
  76.                DoProgram3                 <files precede with a CALL
  77.                CALL Program4              <statement
  78.                       
  79.                :END                       <label for end of batch file
  80.  
  81.  
  82.                If the  place of DoProgram1-4 you can  put one batch file if
  83.           you prefer.  Also keep in  mind that  if any of  these are  batch
  84.           files  that they should be preceded with the 'CALL' command. This
  85.           makes  each batch file executed return to the calling batch file.
  86.           Might  not be always necessary  but it is  the correct procedure.
  87.           Any commands after it are never executed unless it returns to the
  88.           calling batch file.
  89.  
  90.                This is about all  there is to it. DoFirst only produces two
  91.           exitcodes  0 or 1. 0=Found and 1=Not Found/Date found and already
  92.           executed. The program produces an exitcode of 1  if run more than
  93.           once  on first  day of  month. Does  not change  the log  file on
  94.           successive executions. Same as file not found: First Day of month
  95.           found or First Day of month not found.
  96.  
  97.                Typing in DOFIRST ? produces a simple help screen.
  98.  
  99.  
  100.                If you have any problems feel free to contact me.
  101.  
  102.                               James Huckabey
  103.                               3621-A Fraser Street
  104.                               Bellingham, WA 98226-2473 U.S.A.
  105.                               (360) 671-2868 voice, Pacific
  106.  
  107.                See HUCKABEY.TXT for details on getting all my software.